package com.risetechnology.krystalkitchen1;

import android.app.Dialog;
import android.content.Context;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

import com.risetechnology.krystalkitchen1.R.id;

public class ShowTextViewDialog extends Dialog {
	/*
	 * private fields
	 */
	private Context context;
	private LayoutInflater li;
	private View v;
	private TextView popupContent;
	private Button popup_ok;

	/*
	 * constructor
	 */
	public ShowTextViewDialog(Context context, String content) {
		super(context);
		this.context = context;
		init();
		popupContent.setText(content);
		popupContent.setMovementMethod(ScrollingMovementMethod.getInstance());
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		this.setContentView(v);
		this.show();
	}

	/*
	 * initialize method
	 */
	private void init() {
		li = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		v = li.inflate(R.layout.dialog_show_description, null);
		popupContent 	= (TextView)v.findViewById(id.tv_description);
		
		popup_ok		= (Button)v.findViewById(id.btn_ok);
		popup_ok.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				ShowTextViewDialog.this.dismiss();
			}
		});
		
	}
}
